﻿<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=EDGE;IE=11;IE=8,chrome=1" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>工装工具定检提醒查询</title>
    <link href="/InSiteWebApplication/Content/Easyui/themes/metro/easyui.css" rel="stylesheet" />
    <link href="/InSiteWebApplication/Content/Easyui/custom-easyui.css" rel="stylesheet" />
    <link href="/InSiteWebApplication/Content/Easyui/themes/icon.css" rel="stylesheet" />
    <style>
        .easyui-linkbutton{margin-left:20px;}
        table tr td{padding:0px 5px}
        .Btitle{background-color: #ddd; padding: 10px; margin: 5px 10px;}
    </style>
</head>
<body>
    <div class="panelSection">    
        <div class="easyui-panel " title="查询区域" style="padding:3px;width:100%" data-options="closable:false,collapsible:true,minimizable:false,maximizable:false"> 
           <form id="searchForm" method="post">
	    	<table>
	    		<tr class="divLabel">
                    <td>工装工具件号:</td>
                    <td>工装工具图号:</td>
                    <td>工装工具名称:</td>
	    		</tr>
	    		<tr>
	    			<td><input  name="Factory" class="easyui-textbox" style="width: 120px; height: 22px" /></td>
	    			<td><input  name="WorkCenter" class="easyui-textbox" style="width: 120px; height: 22px" /></td>
                    <td><input  name="WorkCenter" class="easyui-textbox" style="width: 120px; height: 22px" /></td>
                    <td> <span style="margin-right: 5px;"><input class="easyui-radiobutton" labelWidth="80px" labelPosition="after" name="IsKeyFeatures" value="1" label="只显示正常"/></span>
                            <input class="easyui-radiobutton" labelWidth="80px" labelPosition="after" name="IsKeyFeatures" value="0" label="只显示异常" checked="true"/>
                     </td>
                    <td><a href="javascript:void(0)" class="easyui-linkbutton" onclick="page.searchData()">查询</a></td>
	    			<td><a href="javascript:void(0)" class="easyui-linkbutton" onclick="page.searchReset()">重置</a></td>
	    		</tr>
	    	</table>
	    </form>
        </div> 
    </div>

    <div class="panelSection">    
      <div class="easyui-panel " title="工装工具定检提醒统计" style="padding:3px;width:100%" data-options="closable:false,collapsible:true,minimizable:false,maximizable:false"> 
        <table id="ToolsGiveCheckRemind" style="height:440px;width:100%" data-options="rownumbers:true"></table>
        <div id="pp" style="float: right" class="easyui-pagination" data-options="   
                 layout:['first','prev','next','last','manual','info'],              
                    total: 0,
                    showPageList: false,
                    showPageInfo: false,
                    showRefresh: false,
                    afterPageText:'共&nbsp{pages}&nbsp页',
                     buttons:[{
                            iconCls:'',
                            text:'Go',
                            id:'pageGo'
                    }]
                ">
                    </div>
        </div>
      </div>
</body>
</html>
<script src="/InSiteWebApplication/Scripts/json2.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/jquery.min.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/jquery.easyui.min.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Scripts/CustomPageJs/CustomCommon.js" type="text/javascript"></script>
<script>
    //创建人：longb
    //日期：2022-07-22
    //描述：工装工具定检提醒查询
    var page = {
        pagetotal: 0,
        pageSize: 20,
        pageNumber: 1,
        index: null,
        rootPath: getRootPath(), //网站根路径
        ajaxUrl: getRootPath() + "/Ashx/ZsHandler/ZSSendRequestHandler.ashx",
        //初始化页面
        init: function () {
            page.bind();
            customizedEasyuiPagination('pp'); //定制化分页
        },
        //页面事件绑定
        bind: function () {
            $('#ToolsGiveCheckRemind').datagrid({
                checkOnSelect: true,
                selectOnCheck: false,
                singleSelect: true,
                rownumbers: true,
                onLoadSuccess: function (data) {
                    $('#pp').pagination('refresh', {	// 改变选项，并刷新分页栏信息
                        total: page.pagetotal,
                        pageSize: page.pageSize,
                        pageNumber: page.pageNumber
                    });
                    customizedEasyuiPagination('pp'); //定制化分页
                },
                columns: [[
                 {field: 'MFGORDERNAME', title: '工装工具件号', width: 140 },
                 {field: 'MFGORDERNAME', title: '工装工具图号', width: 140 },
		         { field: 'CONTAINERNO', title: '工装工具名称', width: 140 },
                 { field: 'PRODUCTNAME', title: '型号规格', width: 90 },
                 { field: 'DESCRIPTION', title: '工装工具类型', width: 100 },
                 { field: 'QTY', title: '定检周期（天）', width: 100 },
		         { field: 'ORDERTYPENAME', title: '定检提醒周期（天）', width: 130, align: 'center' },
                 { field: 'ATTRIBUTEVALUE', title: '上次定检时间', width: 100 },
                 { field: 'PRODUCTFAMILYNAME', title: '下次定检时间', width: 90 },
                 { field: 'PLANNEDSTARTDATE', title: '送检提醒', width: 130 },
                 { field: 'PLANNEDCOMPLETIONDATE', title: '距送检天数', width: 130 }
                ]]
            });
            //分页事件
            $('#pp').pagination({
                onSelectPage: function (pageNumber, pageSize) {
                    customizedEasyuiPagination('pp'); //定制化分页
                    page.pageSize = pageSize; page.pageNumber = pageNumber;
                    page.GetToolsGiveCheckRemind();
                }
            });
            //绑定分页go按钮
            $('#pageGo').on("click", function () {
                var pageNumber = $(this).parents('tr').find('.pagination-num').val();
                page.pageNumber = pageNumber;
                page.GetToolsGiveCheckRemind();
            });
            //清除按钮
            $('#btnReset').on("click", function () {
                page.reset(true, true);
                page.pageNumber = 1; page.pagetotal = 0
                $('#pp').pagination('refresh', {
                    total: page.pagetotal,
                    pageSize: page.pageSize,
                    pageNumber: page.pageNumber
                });
            });
        },
        //查询
        searchData: function () {
            clearMessage();
            page.pageNumber = 1;
            page.GetToolsGiveCheckRemind();
        },
        //查询重置
        searchReset: function () {
            $('#searchForm').form('clear');
            clearMessage();
        },
        //查询任务单信息
        GetToolsGiveCheckRemind: function () {
            var frdata = $('#searchForm').serializeArray();
            var data = {};
            $.each(frdata, function () {
                data[this.name] = this.value
            });
            var param = {
                action: "GetToolsGiveCheckRemind",
                pageSize: page.pageSize,
                pageNumber: page.pageNumber,
                data: JSON.stringify([data])
            };
            page.post(param, function (res) {
                page.pagetotal = res.RowCount;
                $('#ToolsGiveCheckRemind').datagrid('loadData', res.DBTable);
            });
        },
        //清除方法，重要！！！
        reset: function (iscondition, isresult) {
            clearMessage();
        },
        //post数据
        post: function (param, callback) {
            $.ajax({
                type: "Post",
                url: page.ajaxUrl,
                data: param,
                cashe: false,
                async: true,
                dataType: "json",
                beforeSend: function () {
                    $.messager.progress({ text: '', msg: '处理中...' });
                },
                success: function (data) {
                    $.messager.progress('close');
                    callback(data);
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    $.messager.progress('close');
                    displayMessage(XMLHttpRequest.responseText, false);
                }
            });
        }
    }
    $(function () {
        page.init();
    });
</script>
